package com.akk.action;

import com.akk.business.AvsYbPayBusiness;
import com.akk.module.yb.model.YbPayWithDrawRequest;
import com.akk.module.yb.model.YbPaymentNotifyRequest;
import com.akk.utils.RestResponse;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 易宝
 */
@RestController
@RequestMapping("/thmlfApi/avs/ybpay")
public class AvsYbPayAction {

    @Autowired
    private AvsYbPayBusiness ybPayBusiness;

    @PostMapping("/createPay")
    @ApiOperation(value = "发起支付",notes = "发起支付",httpMethod = "POST",response = String.class)
    public RestResponse createPay(String payerId, String orderNum, String cashBindId,String type){
        return ybPayBusiness.register(payerId, orderNum, cashBindId,type);
    }

    @PostMapping("/paymentNotify")
    @ApiOperation(value = "支付通知",notes = "支付通知",httpMethod = "POST",response = String.class)
    public String paymentNotify(YbPaymentNotifyRequest request){
        return ybPayBusiness.paymentNotify(request);
    }

    @PostMapping("/withDrawNotify")
    @ApiOperation(value = "提现通知",notes = "提现通知",httpMethod = "POST",response = String.class)
    public String withDrawNotify(YbPayWithDrawRequest request){
        return ybPayBusiness.withDrawNotify(request);
    }

}
